package com.tony.pmp.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tony.pmp.common.utils.PageUtil;
import com.tony.pmp.common.utils.QueryUtil;
import com.tony.pmp.model.entity.SysProductListEntity;
import com.tony.pmp.model.mapper.SysProductListMapper;
import com.tony.pmp.server.service.SysProductListService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: SysProductListService
 * @Auther: 皮蛋布丁
 * @Date: 2021/08/10/16:45
 * @Description: 商品
 */
@Service("sysProductListService")
public class SysProductListServiceImpl extends ServiceImpl<SysProductListMapper,
        SysProductListEntity> implements SysProductListService {

    /**
    * @Description: queryPage 获取商品列表(分页，模糊查询)
    * @Param: [paramMap]
    * @return: com.tony.pmp.common.utils.PageUtil
    * @Author: 皮蛋布丁
    * @Date: 2021/8/10 16:58
    */
    @Override
    public PageUtil queryPage(Map<String, Object> paramMap) {
        //构造pageNo pageSize
        IPage<SysProductListEntity> page = new QueryUtil<SysProductListEntity>().getQueryPage(paramMap);

        List<SysProductListEntity> list = baseMapper.queryPage(page,paramMap);
        page.setRecords(list);

        return new PageUtil(page);
    }
}
